package cn.com.css.taxInspection.gt3.service.impl;

import org.springframework.stereotype.Service;

import com.baomidou.dynamic.datasource.annotation.DS;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

import cn.com.css.taxInspection.gt3.mapper.JcAjztTjJcDlMapper;
import cn.com.css.taxInspection.gt3.entity.JcAjztTjJcDlEntity;
import cn.com.css.taxInspection.gt3.entity.JcAjztTjJcEntity;
import cn.com.css.taxInspection.gt3.service.JcAjztTjJcDlService;
import cn.com.css.taxInspection.util.TsBqUtils;


@Service("jcAjztTjJcDlService")
public class JcAjztTjJcDlServiceImpl extends ServiceImpl<JcAjztTjJcDlMapper, JcAjztTjJcDlEntity> implements JcAjztTjJcDlService {

	@Override
	@DS("oracle")
	public IPage<JcAjztTjJcDlEntity> infoPage(JcAjztTjJcEntity jcAjztTjJcEntity) {
		
		Page page = new Page(jcAjztTjJcEntity.getPage(), jcAjztTjJcEntity.getLimit());
		LambdaQueryWrapper<JcAjztTjJcDlEntity> queryWrapper = Wrappers.lambdaQuery();
		
		if(TsBqUtils.isNotNull(jcAjztTjJcEntity.getJcry())){
			queryWrapper.like(JcAjztTjJcDlEntity::getJcry, jcAjztTjJcEntity.getJcry());
		}
		if(TsBqUtils.isNotNull(jcAjztTjJcEntity.getNd())){
			queryWrapper.eq(JcAjztTjJcDlEntity::getNd, jcAjztTjJcEntity.getNd());
		}
		if(TsBqUtils.isNotNull(jcAjztTjJcEntity.getSwjgDm())){
			queryWrapper.eq(JcAjztTjJcDlEntity::getSwjgDm, jcAjztTjJcEntity.getSwjgDm());
		}
		
		IPage<JcAjztTjJcDlEntity> iPage = this.page(page, queryWrapper);
		
		return iPage;
	}
}